export function isEdge(cell) {
  return ['edge', 'double-edge'].includes(cell.shape)
}

export function fixEdgeTargetMarker(json) {
  const { cells = [] } = json
  cells.forEach((cell) => {
    if (isEdge(cell)) {
      if (!cell.attrs.line.targetMarker) {
        cell.attrs.line.targetMarker = null
      }
    } else if (cell.attrs.body.magnet) {
      cell.attrs.body.magnet = false
    }
  })
  return json
}
